package com.icloud.article.boot.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.icloud.article.boot.dto.AttachmentDto;
import com.icloud.article.boot.model.Attachment;

import java.util.List;
import java.util.Map;


/**
 * 附件service
 */
public interface AttachmentService extends IService<Attachment> {

    /**
     * 批量添加
     * @param articleId 帖子id
     * @param dtoList 附件
     */
    void batchAdd(Long articleId, List<AttachmentDto> dtoList);


    /**
     * 根据帖子id查询附件
     * @param articleIds 帖子ids
     * @return key:帖子id  value:附件列表
     */
    Map<Long,List<Attachment>> queryAttachmentCountByArticle(List<Long> articleIds);
}
